home *** CD-ROM | disk | FTP | other *** search
- {$O+,R-,S-,B-,I+,F+}
- Unit Einstell;
-
- Interface
-
- uses
- Crt,
- Dos,
- StrTool,
- GEDDEFS,
- KEYSCRN,
- PLOTSYS,
- PLOTSTOR,
- PLSteuer,
- PLGLOB;
-
- Procedure ShowLayers(NFound :Integer);
-
- Procedure Formate;
-
- Procedure SetStiftBreite;
-
- implementation
-
- (*$V-*)
-
-
- Procedure ShowLayers(NFound :Integer);
- Const MaxDir=10;
-
- var
- Taste,TC : Char;
- KeyFunc :Integer;
- first,Last,OldFirst,
- FlipPos,OldFlip:Integer;
- S:Str80;
-
-
- Procedure ShowDir(First,Last:Integer);
- Var I,K,Ref:Integer;
- Layer_Frozen:Boolean;
- Farbe :Byte;
-
- begin
- MakeFrame(wind_dir,ModeWinCol,1);
- WritetoWindow(Wind_Dir,15,1,ModeHeadCol,' Ebenen-Einstellung ');
- WriteToWindow(wind_dir,8,MaxDir+2,ModeHeadCol,
- ' <Ret>: ein/aus <Pg-Dn>:Ändern <ESC>: Ende ');
- FillChar(S,Sizeof(S),32);
- S[0]:=#56;
- For I:=1 to MaxDir do
- WritetoWindow(Wind_dir,2,1+I,ModeNorCol,S);
- For K:=First to Last do
- begin
- Layer_Frozen:=Not(LayerNr(K) in PlotLayers);
- If Layer_Frozen then Farbe:=ModeNorCol else Farbe:=ModeLowCol;
- I:=K-First+1;
- WritetoWindow(Wind_dir,2,I+1,Farbe,'Ebene '+GetLayer(LayerNr(K)));
- WritetoWindow(Wind_dir,12,I+1,Farbe,':');
- If Layer_Frozen then
- WritetoWindow(Wind_dir,15,I+1,Farbe,'ausgeblendet')
- else
- WritetoWindow(Wind_dir,15,I+1,Farbe,'eingeblendet');
- WritetoWindow(Wind_dir,35,I+1,Farbe,'Stiftnummer : ');
- Str(PenLookup[K],S);
- WritetoWindow(Wind_dir,50,I+1,Farbe,S);
- end;
- If Nfound<1 then
- WritetoWindow(Wind_dir,18,5,ModeLowCol,'Keine Einträge gefunden');
- FlushKbd;
- end;
-
- Procedure FlipDir(P:Integer;Color:Byte);
- Var X,Y :Integer;
- begin
- X:=wind_dir.x1+1;
- Y:=Wind_dir.Y1+1+P-First;
- FlipLine(X,Y,Color,56);
- end;
-
- Procedure EditLayer(Var L :Integer);
-
- Const SubWinCol :Byte =Crt.Blue+16 * Crt.LightGray;
- SubHeadCol :Byte =Crt.Black+16* Crt.LightGray;
- Var Sel :Byte;
- Sub_Win : WindowType;
- TC:Char;
- S:Str15;
- K:Integer;
-
-
- Begin
- SaveCrtWindow;
- SaveColors;
- If Not Modeco80 then
- begin
- SubWinCol:=Crt.LightGray*16;
- SubHeadCol:=Crt.White;
- end;
- MakeWindow(Sub_win,Wind_dir.X1+5,Wind_dir.Y1+5,35,3,SubWinCol,wok);
- With Sub_win do
- Window(X1+1,Y1+1,X1+width-2,Y1+height-1);
- MakeFrame(Sub_win,SubWinCol,1);
- WriteToWindow(sub_win,3,1,SubHeadCol,' Ändern Ebene '+GetLayer(LayerNr(L))+' ');
- Str(PenLookup[L],S);
- WriteToWindow(sub_win,3,2,SubWinCol,'Stiftnummer : '+S);
- PutWindow(Sub_win,wok);
- SetEditColors(blue,Lightgray,Crt.White,blue);
- With SetupInfo.PinstInfo Do
- PenLookup[L]:=LeseInt(PenLookup[L],1,17,1,PenMin,PenMax,TC);
- RestoreWindow(Sub_Win,wok);
- DeleteWindow(Sub_win);
- RestoreColors;
- RestoreCrtWindow;
- End;
-
- Procedure Show;
- begin
- Showdir(First,Last);
- ShowWindow(Wind_dir);
- FlipDir(FlipPos,ModeFlpCol);
- end;
-
- BEGIN
- ActualHelp:=90;
- MakeWindow (wind_dir,11,8,58,MaxDir+2,ModeWinCol,wok);
- TC:=#0;
- First:=1;
- Last:=Nfound;
- If Last>MaxDir Then Last:=MaxDir;
- FlipPos:=1;
- Showdir(First,Last);
- PutWindow (wind_dir,wok); { Menü anzeigen }
- If Nfound >0 Then FlipDir(FlipPos,ModeFlpCol);
- IF wok<>0 THEN EXIT;
- Repeat
- KeyFunc:=ReadKbd(Taste);
- If Nfound>0 then
- begin
- Taste:=Upcase(Taste);
- OldFlip:=FlipPos;
- OldFirst:=First;
- If Taste<>#0 then
- Case Taste of
- '1'..'8',
- 'A'..'X':
- FlipPos:=EbenenIndex(GetEbene(Taste));
- ^E :FlipPos:=FlipPos-1;(*Pfeil rauf *)
- ^X :FlipPos:=FlipPos+1;(*Pfeil runter*)
- ^F :Flippos:=NFound; { Ende }
- ^A :FlipPos:=1; { Anfang }
- ^Q :begin
- EditLayer(FlipPos);
- Show;
- Inc(FlipPos,1);
- End;
- ^M :begin
- If LayerNr(FlipPos) in PlotLayers then
- PlotLayers:=PlotLayers-[LayerNr(FlipPos)]
- else
- PlotLayers:=PlotLayers+[LayerNr(FlipPos)];
- Show;
- Inc(FlipPos,1);
- end;
- end;
- If OldFlip<>FlipPos Then
- begin
- If FlipPos<1 then FlipPos:=1;
- If FlipPos>Nfound Then FlipPos:=Nfound;
- If (FlipPos<First) then First:=Flippos;
- If (Flippos>Last) then
- If Flippos=Nfound then First:=Nfound-Maxdir+1
- else
- If FlipPos>Last+1 then First:=First+(Maxdir*2 div 3)
- else First:=First+1;
- If First>Nfound-Maxdir+1 Then
- First:=Nfound-MaxDir+1;
- If First<1 Then First:=1;
- Last:=First+MaxDir-1;
- If Last>Nfound then Last:=Nfound;
- Limit(Flippos,First,Last);
- If OldFirst<>First Then Show
- else
- begin
- If LayerNr(OldFlip) in PlotLayers then
- FlipDir(OldFlip,ModeLowCol)
- else
- FlipDir(OldFlip,ModeNorCol);
- FlipDir(FlipPos,ModeFlpCol);
- end;
- end;
- end;
- UNTIL Taste in [Esc,^Z];
- RestoreWindow (wind_dir,wok); { Hintergrund anzeigen }
- DeleteWindow(Wind_dir);
- END;
-
- Type BooleanRep =Array[Boolean] of Str10;
- Const JaNein :BooleanRep =('N','J');
-
-
- Procedure LeseBoolean(Var B:Boolean;X,Y:Integer;Var TC:Char);
- Var S:String[10];
- begin
- S:=Janein[B];
- InputKbd(S,1,X,Y,Term,['J','j','n','N'],TC);
- S:=UpcaseStr(S);
- B:=S='J';
- end;
-
- Function CtrlSEQ_to_String(Var Ctrl :Str64):Str64;
- Var S1 :Str64;
- Num:Str10;
- I,C:Integer;
- begin
- S1:='';
- For I:=1 to Length(Ctrl) do
- begin
- C:=Ord(Ctrl[I]);
- If C<32 then
- begin
- Str(C,Num);
- While Not(Num[1] in ['0'..'9']) Do Delete(Num,1,1);
- S1:=S1+'{'+Num+'}'
- end
- else S1:=S1+Ctrl[I];
- end;
- CtrlSEQ_to_String:=S1;
- end;
-
- Function ConvertCtrlSeq(Var S:Str64):Boolean;
- Var Sout :Str64;
- I,L:Integer;
- Snum :Str10;
- Sonderzeichen,Error :Integer;
- Ok,ParseChar :Boolean;
- begin
- L:=Length(S);
- I:=1;
- Ok:=true;
- ParseChar:=true;
- Sout:='';
- While (I<=L) and ok Do
- begin
- If ParseChar then
- begin
- If S[I]='{' then begin ParseChar:=false; Snum:=''; end
- else
- begin
- OK:=S[I]<>'}';
- If OK then Sout:=Sout+S[I];
- end;
- end
- else
- begin
- If S[I]='}' then
- begin
- ParseChar:=true;
- OK:=(Length(Snum)<>0) and (Length(Snum)<4);
- If Ok then
- begin
- Val(Snum,Sonderzeichen,Error);
- Ok:=(Sonderzeichen<256) and (Error=0);
- If Ok then Sout:=Sout+Chr(Sonderzeichen);
- end;
- end
- else
- begin
- OK:=S[I] in ['0'..'9'];
- If OK then Snum:=Snum+S[I];
- end;
- end;
- I:=Succ(I);
- end;
- If Not(OK) then Delete(S,I-1,L-I+2)
- else S:=Sout;
- ConvertCtrlSeq:=OK;
- end;
-
- Procedure InputCtrlSeq(Var S:Str64;L,X,Y:Integer; Var TC :Char);
- Var TempStr,Si :Str64;
- OK:Boolean;
- Li :Integer;
- begin
- Li:=(5 * L) div 2;
- If Li>60 then Li:=60;
- Si:=CtrlSEQ_to_String(S);
- Repeat
- InputKbd(Si,Li,X,Y,Term,[#32..#255],TC);
- tempStr:=Si;
- OK:=ConvertCtrlSeq(TempStr);
- If Not(Ok) then begin beep;Si:=TempStr;end;
- Until OK or (TC=Esc);
- While Length(Tempstr)>L do Delete(Tempstr,Length(TempStr),1);
- If TC<>Esc then S:=TempStr;
- end;
-
-
- Procedure Formate;
- Var TC :Char;
- L :Integer;
-
-
- Procedure ClearForm;
- Var L : Integer;
- Begin
- ClrScr;
- LowVideo;
- HeadLine('Plotformat-Einstellungen');
- Line25;
- GotoXY(1,2);Write('DATEI : ');
- Normvideo;Write(FileSetup.DWG);
- Lowvideo;
- GotoXY(45,2);Write('Name des Formats : ');
- Normvideo;
- If Actualparname='' then Write('--') else Write(ActualparName);
- LowVideo;
- GotoXY(45,3);Write('Druck-Modus : ',PlotModeREP[PlotModus]);
- If PlotModus=Loetstop then
- begin
- GotoXY(45,4);
- Write('Zugabe : ',LoetstopPlus:3:1);
- end;
- LowVideo;
- GotoXY(1,5);Write('Einheit (fix): mm');
- GotoXY(1,6);Write('Maßstab =');
- GotoXY(1,7);Write('Ursprung : X= Y=');
- GotoXY(1,8);Write('Schriftdicke (in % der Höhe) :');
- GotoXY(1,9);Write('Linienanpassung (rund) :');
- GotoXY(1,10);Write('Linienteilung gestrichelt : (1..25 mm)');
- GotoXY(1,11);Write('Linienteilung strichpunktiert : (1..25 mm)');
- GotoXY(1,13);Write('Offset : X= Y=');
- GotoXY(1,14);Write('Fenster :X1= Y1=');
- GotoXY(1,15);Write('Fenster :X2= Y2=');
- GotoXY(1,16);
- With SetUpInfo.SetupPlotter Do
- Write('maximal :X = ',MinFormX,'..',FormX,
- ' mm Y = ',MinformY,'..',FormY,' mm');
- GotoXY(1,18);Write('Seitenverkehrt drucken (J/N) ?');
- GotoXY(1,19);Write('Im Hoch-Format drucken (J/N) ?');
- GotoXY(1,20);Write('Auf Datei ausgeben (J/N) ?');
- GotoXY(1,21);
- With SetUpInfo.PinstInfo Do
- Write('Plot-Geschwindigkeit (',Speedmin,'..',SpeedMax,'mm/sec) :');
- GotoXY(1,22);Write('INIT-Sequenz :');
- GotoXY(1,23);Write('EXIT-Sequenz :');
- Normvideo;
- End;
-
- Procedure WriteForm;
- Var K : Integer;
- Begin
- With SetupInfo.Voreinstellung,SetUpInfo.PinstInfo Do
- Begin
- RealStr(Einheit,9,OutString);
- GotoXY(15,5);Lowvideo;Write(OutString);NormVideo;
- RealStr(PlotScale,6,OutString);
- GotoXY(15,6);Write(OutString);
- RealStr(Ursprung.X*Einheit,9,OutString);
- GotoXY(15,7);Write(OutString);
- RealStr(Ursprung.Y*Einheit,9,OutString);
- GotoXY(34,7);Write(OutString);
- RealStr(Schriftdicke*100,6,OutString);
- GotoXY(34,8);Write(OutString);
- GotoXY(34,9);Write(JaNein[AdaptLines]);
- RealStr(Lscaledashed,5,OutString);
- GotoXY(34,10);Write(OutString);
- RealStr(Lscaledotted,5,OutString);
- GotoXY(34,11);Write(OutString);
- GotoXY(15,13);Write(PlotOffset.X);
- GotoXY(34,13);Write(PlotOffset.Y);
- GotoXY(15,14);Write(FensterX1);
- GotoXY(34,14);Write(FensterY1);
- GotoXY(15,15);Write(FensterX2);
- GotoXY(34,15);Write(FensterY2);
- GotoXY(32,18);Write(JaNein[Spiegeln]);
- GotoXY(32,19);Write(JaNein[Portrait]);
- GotoXY(32,20);Write(Janein[Aufdatei]);
- With SetUpInfo.PinstInfo Do
- begin
- GotoXY(40,21);
- Write(PlotSpeed);
- end;
- GotoXY(15,22);Write(CtrlSeq_to_String(DeviceInit));
- GotoXY(15,23);Write(CtrlSeq_to_String(DeviceExit));
- End;
- End;
-
- Procedure Mainform;
- begin
- L:=1;
- With SetupInfo.Voreinstellung,SetupInfo.PinstInfo,SetupInfo.SetUpPlotter Do
- Begin
- Repeat
- Case L of
- 1 : PlotScale:=LeseReal(PlotScale,6,15,6,0.01,100.0,TC);
- 2 : Ursprung.X:=RasterMass(LeseReal(Istmass(Ursprung.X),9,
- 15,7,0.0,Einheit*EdMaxXY*0.9,TC));
- 3 : Ursprung.Y:=RasterMass(LeseReal(Istmass(Ursprung.Y),9,
- 34,7,0.0,Einheit*EdMaxXY*0.9,TC));
- 4 : Schriftdicke:=0.01*LeseReal(Schriftdicke*100,6,34,8,0.0,20,TC);
- 5 : LeseBoolean(Adaptlines,34,9,TC);
- 6: Lscaledashed:=LeseReal(Lscaledashed,5,34,10,
- LineScaleMin,LinescaleMax,TC);
- 7: Lscaledotted:=LeseReal(Lscaledotted,5,34,11,
- LineScaleMin,LinescaleMax,TC);
- 8 : Plotoffset.X:=LeseInt(PlotOffset.X,4,15,13,MinFormX,FormX,TC);
- 9 : Plotoffset.Y:=LeseInt(PlotOffset.Y,4,34,13,MinFormY,FormY,TC);
- 10 : FensterX1:=LeseInt(FensterX1,4,15,14,MinFormX,FormX,TC);
- 11 : FensterY1:=LeseInt(FensterY1,4,34,14,MinFormY,FormY,TC);
- 12 : FensterX2:=LeseInt(FensterX2,4,15,15,MinFormX,FormX,TC);
- 13 : FensterY2:=LeseInt(FensterY2,4,34,15,MinFormY,FormY,TC);
- 14 : LeseBoolean(Spiegeln,32,18,TC);
- 15 : LeseBoolean(Portrait,32,19,TC);
- 16 : LeseBoolean(AufDatei,32,20,TC);
- 17 : PlotSpeed:=LeseInt(PlotSpeed,3,40,21,SpeedMin,SpeedMax,TC);
- 18 : InputCtrlSeq(DeviceInit,62,15,22,TC);
- 19 : InputCtrlSeq(DeviceExit,62,15,23,TC);
- end;
- Until Menueende(L,19,1,TC);
- GrafWindow(FensterX1,FensterY1,FensterX2,FensterY2);
- End;
- end;
-
- Begin
- ActualHelp:=87;
- ClearForm;
- WriteForm;
- MainForm;
- End;
-
- Procedure SetStiftBreite;
- Var TC :Char;
- L :Integer;
- begin
- ActualHelp:=56;
- ClrScr;
- HeadLine('Vorgabe der Stiftbreiten');
- Line25;
- With SetupInfo.PinstInfo do
- begin
- For L:= PenMin to PenMax do
- begin
- GotoXY(1,L+3);
- LowVideo;
- Write('Nummer des Stifts : ',L);
- GotoXY(30,L+3);Write('Breite : mm');
- GotoXY(39,L+3);
- RealStr(Stiftbreiten[L],6,OutString);
- NormVideo;
- Write(OutString);
- end;
- L:=PenMin;;
- Repeat
- If L<PenMin then L:=PenMin;
- StiftBreiten[L]:=LeseReal(Stiftbreiten[L],6,39,L+3,0.0,2.0,TC);
- Until Menueende(L,Penmax,1,TC);
- end;
- end;
-
-
-
- end.